package xyz.mayday.tools.bunny.todo.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.mayday.tools.bunny.ddd.core.controller.BaseControllerImpl;
import xyz.mayday.tools.bunny.ddd.schema.page.PageableData;
import xyz.mayday.tools.bunny.ddd.schema.query.CommonQueryParam;
import xyz.mayday.tools.bunny.ddd.schema.service.BaseService;
import xyz.mayday.tools.bunny.todo.domain.TodoDO;
import xyz.mayday.tools.bunny.todo.query.TodoQuery;
import xyz.mayday.tools.bunny.todo.service.TodoService;
import xyz.mayday.tools.bunny.todo.vo.TodoVO;

/**
 * @author gejunwen
 */
@RequestMapping("/api/v1/todo")
@RestController
@RequiredArgsConstructor
@Api(tags = "待办")
public class TodoController extends BaseControllerImpl<Long, TodoVO, TodoQuery, TodoDO> {

    final TodoService todoService;

    @Override
    public BaseService<Long, TodoDO> getService() {
        return todoService;
    }

    @ApiOperation("查询待办")
    @GetMapping
    @Override
    public PageableData<TodoVO> queryItems(TodoQuery todoQuery, CommonQueryParam commonQueryParam) {
        return super.queryItems(todoQuery, commonQueryParam);
    }
}
